"use strict";

// 表单提交
;(function() {
  var $form = $('#form240724');
  var $submit = $form.find('.submit');
  var $warning = $('#warning');

  $submit.bind({
    'click' (e) {
      e.preventDefault();
      var values = $form.serializeArray();
      var isok = true;
      for (let i = 0; i < values.length; i++) {
        var item = values[i];
        if (!item.value) {
          $warning.show().find('.text p').text('( ' + item.name + ') is required !');
          setTimeout(() => {
            $warning.hide();
          }, 2000)
          isok = false;
          break
        }
      }
      if (isok) {
        console.log('在这里调接口')
      }
    }
  })
})(window, jQuery);


